package com.ocom.wxapi.controller;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.resp.Result;
import com.ocom.security.authentication.YoCiUser;
import com.ocom.security.utils.SecurityUtils;
import com.ocom.wxapi.client.PayConfigClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DishesController {
    @Autowired
    private PayConfigClientService payConfigClientService;


    @PostMapping("/DishesClass/onShow")
    public Result dishesClassOnShow(Integer merchId,Long comId) {
//        Integer merchId = jsonObject.getInteger("merchId");
//        YoCiUser yoCiUser = SecurityUtils.getYoCiUser();
//        if ((yoCiUser.getRole() == 41l || yoCiUser.getRole() == 42l || yoCiUser.getMerchId()>0l) && merchId == 0) {
//            merchId = yoCiUser.getMerchId().intValue();
//        }
        return payConfigClientService.dishesClassList(comId, merchId);
    }
}
